{% extends "myadmin/base.html" %}

{% block mainbody %}

<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        会员管理
        <small>订餐系统后台管理</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">会员信息表</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <form class="form-inline" action="{% url 'myadmin_member_index' 1 %}" method="get">
            <div class="box-header">
              <h3 class="box-title"><i class="fa fa-calendar"></i> 会员信息表</h3>
                  <div class="box-tools">
                    <div class="input-group input-group-sm" style="width: 150px;">
                      <input type="text" name="keyword" value="{{ request.GET.keyword }}" class="form-control pull-right" placeholder="Search">
                      <div class="input-group-btn">
                        <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                      </div>
                    </div>
                  </div>
            </div>
            </form>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tr>
                  <th>ID</th>
                  <th>昵称</th>
                  <th>头像</th>
                  <th>联系电话</th>
                  <th>当前状态</th>
                  <th>添加时间</th>
                  <th>操作</th>
                </tr>
                {% for vo in usersList %}
                <tr>
                  <td>{{ vo.id }}</td>
                  <td>{{ vo.nickname }}</td>
                  <td><img style="height:40px" src="/static/uploads/member/{{ vo.avatar }}"></td>
                  <td>{{ vo.mobile }}</td>
                  <td>{% if vo.status == 1 %}<span class="label label-success">正常</span>{% elif vo.status == 2%}<span class="label label-danger">禁用</span>{% else%}<span class="label label-danger">删除</span>{% endif %}</td>
                  <td>{{ vo.create_at }}</td>
                  <td>
                    <a href="{% url 'myadmin_member_edit' vo.id %}">
                        <button type="button" class="btn btn-success btn-xs">
                          <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 编辑</button>
                    </a>
                  </td>
                </tr>
                {% endfor %}
              </table>
            </div>
            <!-- /.box-body -->
            <div class="box-footer clearfix">
              <ul class="pagination pagination-sm no-margin pull-right">
                <li>
                    <a href="{% url 'myadmin_member_index' pIndex|add:-1 %}?{{ mywhere|join:'&' }}">&laquo;</a>
                </li>
                {% for pp in plist %}
                    <li {% if pIndex == pp %} class="active" {% endif %}>
                        <a href="{% url 'myadmin_member_index' pp %}?{{ mywhere|join:'&' }}">{{ pp }}</a>
                    </li>
                {% endfor %}
                <li>
                    <a href="{% url 'myadmin_member_index' pIndex|add:1 %}?{{ mywhere|join:'&' }}">&raquo;</a>
                </li>
              </ul>
            </div>
          </div>
          <!-- /.box -->
        </div>
      </div>

    </section>
    <!-- /.content -->
  </div>
{% endblock %}